<template>
	<view class="user">
		<view class="top">
			<image src="/static/images/record.png" mode="aspectFill"></image>
			<view class="text">
				浏览历史
			</view>
		</view>
		<view class="noData" v-if="data.length<=0">
			<image src="/static/images/noData.png" mode="widthFix"></image>
		</view>
		<view class="content" v-else>
			<view class="row" v-for="(value,index) in data">
					<newbox :item="value"></newbox>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:[]
			};
		},
		onShow(){
			this.getDate();
		},
		methods:{
			getDate(){
				this.data = uni.getStorageSync("historyArr") || [];
			}
		}
	}
</script>

<style lang="scss">
.user{
	.top{
		padding: 50rpx 0;
		background-color: #F8F8F8;
		color: #555;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		image{
			width: 150rpx;
			height: 150rpx;
		}
		.text{
			font-size: 40rpx;
			padding-top: 30rpx;
		}
	}
	.content{
		padding: 30rpx;
		.row{
			border-bottom: 1px dashed #efefef;
			padding: 15rpx 0;
		}
	}
	.noData{
		padding: 100rpx 0;
		image{
			width: 70%;
			margin: 0rpx 15%;
		}
	}
}
</style>
